<?php
namespace test;
/**
* @autor:士大夫
*/
class B{
	function __construct(\test\A $dd){
		
	}
}
class A extends B{
	const DSP='56';
	
	/**
	* $fun1
	*/
	function fun1(){
	
	}
	
	function fun2($name){
	
	}
	/**
	*sdafsd fas
	*/
	function fun3(){
		echo DSP;
	}
}

function echo2($str){
	var_dump($str);echo '<br/>';
}


$class = new \ReflectionClass('test\A');
	   
//$instance  = $class->newInstanceArgs($args);//相当于实例化Person 类 
echo2($class->getName()); //test\A
echo2($class->getConstants()); //test\A
echo2($class->getConstructor()->getParameters()[0].getType()); //test\A
echo2($class->getDocComment()); //test\A
//解析类的注释头  

echo2($class->getMethods()); //test\A
echo2($class->getShortName ()); //test\A
echo2($class->hasMethod('fun1')); //-------------
echo2($class->getMethod('fun1'));

$instance  = $class->newInstance();//相当于实例化Person 类 
$fun = $class->getMethod('fun3');
$fun->invoke($instance,[]);
echo "over";